﻿using Ecommerce.Domain.Dto;
using EcommerceRabbit.API.Application.Command.Trace;
using EcommerceRabbit.Servies.traceability;
using MediatR;

namespace EcommerceRabbit.API.Application.CommandHandler.Trace
{
    public class TraceFanCommandhandler : IRequestHandler<TraceFanCommand, List<TraceDTO>>
    {
        private readonly ITraceServices services;

        public TraceFanCommandhandler(ITraceServices services)
        {
            this.services = services;
        }

        public Task<List<TraceDTO>> Handle(TraceFanCommand request, CancellationToken cancellationToken)
        {
            return services.GetTraceDTO(request.Tid);
        }
    }
}
